<%@ Control Language="C#" AutoEventWireup="true" CodeFile="loginpanel.ascx.cs" Inherits="forums_controls_login_loginpanel" %>
<asp:Panel runat="server" ID="pnlLogin"
    CssClass="login_panel"
    DefaultButton="btnLogin">
    <asp:MultiView runat="server" ID="mviewLogin" ActiveViewIndex="0">
        <asp:View runat="server" ID="viewAnonymous">
            <table width="100%">
                <tr>
                    <td width="50%">
                        <asp:CustomValidator ID="valUsername" runat="server"
                            ControlToValidate="txtUsername"
                            ErrorMessage="Incorrect username or password.<br />"
                            EnableClientScript="false"
                            ValidationGroup="Login" OnServerValidate="valUsername_ServerValidate" />
                        Username: <asp:TextBox runat="server" ID="txtUsername" /><br />
                        Password: <asp:TextBox runat="server" ID="txtPassword" TextMode="Password" /><br />
                        <asp:Button runat="server" ID="btnLogin"
                            Text="Login" OnClick="btnLogin_Click" ValidationGroup="Login" />
                    </td>
                    <td width="50%" style="text-align : right; vertical-align : bottom;">
                        <asp:HyperLink runat="server" ID="lnkRegister"
                            NavigateUrl="~/forums/register.aspx"
                            Text="Register A New Account" />
                        |
                        <asp:HyperLink runat="server" ID="lnkSearch1"
                            Text="Search Forums"
                            NavigateUrl="~/forums/search.aspx"/>
                        |
                        <asp:Hyperlink runat="server" ID="lnkHome1"
                            Text="FSTDT Home"
                            NavigateUrl="~/default.aspx" />
                    </td>
                </tr>
            </table>
        </asp:View>
        <asp:View runat="server" ID="viewAuthenticated">
            <p>
                Hello, <asp:Label runat="server" ID="lblUsername" Text="[Username]" />
            </p>
            <p>
            <asp:HyperLink runat="Server" ID="lnkUserCP"
                Text='UserCP'
                NavigateUrl='~/forums/usercp.aspx' />
            |
            <asp:HyperLink runat="Server" ID="lnkMembers"
                Text='Members'
                NavigateUrl='~/forums/members.aspx' />
            | 
            <asp:LinkButton runat="server" ID="lnkLogout"
                Text="Logout"
                OnClick="lnkLogout_Click"/>
            |
            <asp:HyperLink runat="server" ID="lnkSearch2"
                Text="Search Forums"
                NavigateUrl="~/forums/search.aspx"/>
            |
            <asp:Hyperlink runat="server" ID="lnkHome2"
                Text="FSTDT Home"
                NavigateUrl="~/default.aspx" />
            </p>
        
        </asp:View>
    </asp:MultiView></asp:Panel>
